import requests
from bs4 import BeautifulSoup
from datetime import datetime


res = requests.get('http://news.sina.com.cn/c/nd/2017-08-04/doc-ifyitayr8996979.shtml')
res.encoding = 'utf-8'
soup = BeautifulSoup(res.text, 'html.parser')

title = soup.select('#artibodyTitle')[0].text
time_source = soup.select('.time-source')[0].contents[0].strip()
context_source = soup.select('.time-source a')[0].text
print(context_source, time_source, title)

' '.join([p.text.strip() for p in soup.select('#artibody p')[:-2]])


soup.select('.article-editor')[0].text.strip()
